/****************************************************************************
 *
 * Copyright (C) 2003-2008 Los Alamos National Security, LLC
 *                         Packet Analytics Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License Version 2 as
 * published by the Free Software Foundation.  You may not use, modify or
 * distribute this program under any other version of the GNU General
 * Public License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 ****************************************************************************/
package nfse.gui.client.data;

import java.util.*;

import com.google.gwt.user.client.rpc.IsSerializable;


public class SnapShotDataType  implements IsSerializable
{

	private HashMap categoryMap;
		
	public SnapShotDataType()
	{
		
	}
	
		
	public HashMap populateDisplayCategories()
	{
		return categoryMap;
	}
	
	/**
	 * This is for one complete Data Type
	 * @param limitHeaders
	 * @return
	 */
	public HashMap populateTestDisplayCategories(int limitHeaders)
	{		
		String[] addresses = {"100.0.1.100","123.45.23.12","90.120.234.10","100.0.1.100","123.45.23.12","90.120.234.10","100.0.1.100","123.45.23.12","90.120.234.10","90.120.234.10"};
		String[] hits = {"1500","123","90","1500","123","90","1500","123","90","1500"};
		String[] ports = {"80","23","8080","80","23","8080","80","23","8080","80"};
		
		String[] snapShotHeaders = {"Top Sources","Top Targets","Top Destinations"};
		int categoryRecordCount = 10;
		//All the snapshots ordered by data type
		HashMap categoryMap = new HashMap();
		for (int i = 0; i < limitHeaders; i++) {
			//Map of the categories per data type where the key is the category type
			ArrayList categoryRecords = new ArrayList();
			for (int j = 0; j < categoryRecordCount; j++) {
				SnapShotDataTypeCategoryRecord ssRecord = new SnapShotDataTypeCategoryRecord();
				
				if (i == 2)
				{
					ssRecord.setHits(hits[j]);
					ssRecord.setPort(ports[j]);
				}
				else
				{
					ssRecord.setAddress(addresses[j]);
					ssRecord.setHits(hits[j]);				
				}
				
				categoryRecords.add(ssRecord);
			}
			categoryMap.put(snapShotHeaders[i],categoryRecords);				
		}
		
		return categoryMap;
	}
	
}
